import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

public class UdpDicServer extends UdpEchoServer{
    Map<String,String> map = new HashMap<>();

    public UdpDicServer(int id) throws SocketException {
        super(id);
        map.put("Cat","猫咪");
        map.put("Dog","狗狗");
        map.put("fuck","卧槽");
    }

    @Override
    public String Persson(String str) {
        return map.getOrDefault(str,"找不到!");

    }

    public static void main(String[] args) throws IOException {
        UdpDicServer dicServer = new UdpDicServer(2000);
        dicServer.stack();
    }
}
